package com.huanwei.mainfragment.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.huanwei.cc.base.Base_Z_Adapter;
import com.huanwei.cc.base.MyApplication;
import com.huanwei.cc.R;
import com.huanwei.cc.bean.Paim_Bean;


/**
 * Created by 他的猫 on 2016/12/3.
 * 语音播放适配器
 */

public class Speach_Adapter extends Base_Z_Adapter {
    Speach_Adapter.Holder holder;

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        // 查找控件
        if (null == convertView) {
            convertView = LayoutInflater.from(MyApplication.getInstance())
                    .inflate(R.layout.tab_item_1_pm, null);
            holder = new Speach_Adapter.Holder();
            holder.tv_rname = (TextView) convertView
                    .findViewById(R.id.tv_name);
            holder.tv_bank = (TextView) convertView
                    .findViewById(R.id.tv_bank);


            // 缓存Holder
            convertView.setTag(holder);
        } else {
            holder = (Speach_Adapter.Holder) convertView.getTag();
        }
        Paim_Bean item = (Paim_Bean) getItem(position);
        holder.tv_bank.setText(item.getJieshao());
        holder.tv_rname.setText(item.getName());
        return convertView;
    }

    public class Holder {
        TextView tv_rname;
        TextView tv_bank;

    }
}
